﻿using System;
using System.Collections.Generic;
using System.Text;
using MyHotel_BUSWS.MyHotel_TaiKhoanDAO_Webservice;
using MyHotel_BUSWS.MyHotel_NhanVienDAO_Webservice;

namespace MyHotel_BUSWS
{
    public class MHDangNhap
    {
        public enum ResultLogin { NotExist, Success};

        public static NhanVien KiemTraDN(string tendangnhap, string matkhau)
        {
            NhanVienDAOWSSoapClient ws = new NhanVienDAOWSSoapClient();
            NhanVien[] listNhanVien = ws.getList(); ;

            foreach (NhanVien nv in listNhanVien)
            {
                if (tendangnhap.ToLower() == nv.Tendangnhap.ToLower() && matkhau.ToLower() == nv.Matkhau.ToLower())
                    return nv;
            }

            return null;
        }
    }
}
